

//起风了

#include "pitches.h"
int tune[]=                 
{
  C0,F4,FH4,GH4,AH4,AH3,CH4,CH5,AH4,CH3,F3,GH3,
     F4,FH4,GH4,AH4,AH3,CH4,CH5,AH4,GH4,AH4,FH4,GH4,F4,FH4,CH4,
     F4,FH4,GH4,AH4,AH3,CH4,CH5,AH4,CH3,F3,GH3,
     F4,FH4,GH4,AH4,AH3,CH4,CH5,AH4,GH4,AH4,FH4,GH4,F4,FH4,CH4,
     F5,FH5,GH5,AH5,AH3,CH5,CH6,AH5,CH3,F3,GH3,
     F5,FH5,GH5,AH5,AH3,CH5,CH6,AH5,GH5,AH5,FH5,GH5,F5,FH5,CH5,
     F5,FH5,GH5,AH5,AH3,CH5,CH6,AH5,CH3,F3,GH3,C0,
     GH4,G4,C0,
     GH4,FH4,GH4,FH4,GH4,AH4,CH5,AH4,
     GH4,FH4,GH4,FH4,GH4,AH4,GH4,FH4,CH4,
     GH4,FH4,GH4,FH4,GH4,AH4,CH5,AH4,
     GH4,AH4,GH4,FH4,GH4,C0,
     GH4,FH4,GH4,FH4,GH4,AH4,CH5,AH4,
     GH4,AH4,GH4,FH4,DH4,C0,
     AH4,GH4,FH4,GH4,FH4,FH3,
     AH4,GH4,FH4,GH4,FH4,CH4,
     AH4,GH4,FH4,GH4,FH4,CH4,FH4,CH4,
     FH4,GH4,AH4,FH4,DH5,CH5,DH5,
     FH4,F5,DH5,F5,CH4,GH3,
     F5,DH5,F5,AH4,FH5,GH5,FH5,F5,DH5,CH5,
     DH5,CH5,DH5,CH5,DH5,CH5,DH5,CH5,GH4,CH5,AH4,C0,
     FH4,GH4,AH4,FH4,DH5,CH5,DH5,FH4,
     F5,DH5,F5,C0,
     F5,DH5,F5,AH4,FH5,GH5,FH5,F5,DH5,CH5,
     DH5,AH5,AH5,CH5,DH5,AH5,AH5,CH5,DH5,C0,
     FH5,GH5,AH5,DH6,CH6,DH6,CH6,DH6,CH6,GH5,C0,
     AH5,DH6,CH6,DH6,CH6,DH6,CH6,AH5,
     GH5,FH5,DH5,FH5,DH5,GH5,FH5,DH5,FH5,
     AH5,B5,AH5,B5,AH5,GH5,
     FH5,GH5,AH5,DH6,CH6,DH6,CH6,DH6,CH6,GH5,
     AH5,DH6,CH6,DH6,CH6,DH6,CH6,AH5,
     GH5,FH5,DH5,AH5,GH5,FH5,DH5,FH5,FH5,AH3,DH4,AH3,FH4,C0,
     DH5,AH5,
     GH5,FH5,DH5,AH5,GH5,FH5,DH5,FH5,FH5,
     F5,FH5,GH5,AH5,AH3,CH5,CH6,AH5,CH3,F3,GH3,C0,
     F5,FH5,GH5,AH5,AH3,CH5,CH6,AH5,GH5,AH5,FH5,GH5,F5,FH5,CH5,
     F5,FH5,GH5,AH5,AH3,CH5,CH6,AH5,CH3,F3,GH3,C0,
     GH4,G4,C0
};
//编译歌谱
int durt[]=                   
{
  2500,183,183,183,183,183,183,183,183,366,366,732,
       183,183,183,183,183,183,183,183,183,183,183,183,183,183,366,
       183,183,183,183,183,183,183,183,366,366,732,
       183,183,183,183,183,183,183,183,183,183,183,183,183,183,366,
       183,183,183,183,183,183,183,183,366,366,732,
       183,183,183,183,183,183,183,183,183,183,183,183,183,183,366,
       183,183,183,183,183,183,183,183,366,366,548,183,
       1463,1097,366,
       548,183,548,183,366,366,366,366,
       548,183,548,183,183,183,183,183,732,
       548,183,548,183,366,366,366,366,
       548,183,366,366,1097,366,
       548,183,548,183,366,366,366,366,
       548,183,366,366,548,183,
       183,183,183,183,548,183,
       183,183,183,183,548,183,
       183,183,183,183,366,366,366,366,
       366,366,366,366,366,183,548,
       183,366,183,183,366,366,
       366,183,548,366,183,183,183,183,366,366,
       366,183,366,183,183,183,366,183,548,366,1097,366,
       366,366,366,366,366,183,548,183,
       366,183,732,183,
       366,183,548,366,183,183,183,183,366,366,
       366,183,548,366,366,183,548,366,1097,366,
       366,366,366,183,548,183,548,183,366,548,183,
       366,183,548,183,548,183,366,732,
       366,183,366,366,183,366,183,366,732,
       732,183,366,92,92,732,
       366,366,366,183,548,183,548,183,366,366,
       366,183,548,183,548,183,366,732,
       366,183,548,366,366,183,366,732,366,366,366,366,366,366,
       183,548,
       366,183,548,366,366,183,366,732,183,
       183,183,183,183,183,183,183,183,366,366,548,183,
       183,183,183,183,183,183,183,183,183,183,183,183,183,183,366,
       183,183,183,183,183,183,183,183,366,366,548,183,
       1463,1097,366
};
//输入每个音的持续时长
int length;
int tonepin=6;  //使用PMN6输出口 

void setup() {
  // put your setup code here, to run once:
   //识别数组长度
 pinMode(tonepin,OUTPUT);
  length=sizeof(tune)/sizeof(tune[0]);
}

void loop() {
  // put your main code here, to run repeatedly:
  for(int x=0;x<length;x++)
  {
    tone(tonepin,tune[x]);
    delay(durt[x]);   
    noTone(tonepin);
  }
  delay(5000);
}
